home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 05.zip
/
BS1 part 5
/
PDraw3.0.adf
/
pdraw_rex.lzh
/
Mandela.pdrx
< prev
next >
Wrap
Text File
|
1992-06-15
|
2KB
|
94 lines
/*
@N
This Genie will draw connected polygons on the screen
*/
msg = PDSetup.rexx(2,0)
units = getclip(pds_units)
if msg ~= 1 then exit_msg(msg)
numeric digits 8
pi2 = 6.28318
cr = '0a'x
custom = pdm_inform(2,"Select Base Shape","Circle","Custom")
if custom = 0 then do
man = pdm_getform("Enter mandela info",4,"sides"cr"radius")
if man = '' then exit_msg()
parse var man order '0a'x radius
if ~(datatype(order, n) & datatype(radius, n)) then
exit_msg("Invalid Entry")
if units > 2 then radius = pdm_ConvertUnits(units,1, radius)
ang = pi2 / order
posn = pdm_clickellipse("where eh?",radius,radius)
call pdm_initplot(word(posn,1),word(posn,2),1,1,0)
do steps = 0 to order-1
theta = ang * steps
x = cos(theta) * radius
y = sin(theta) * radius
plotline(x" "y)
end
obj = pdm_closeplot()
end
else
do
obj = pdm_clickonobj("Select the custom object")
if obj = 0 then exit_msg()
end
/* draw the stars to complete the above object */
order = pdm_getobjorder(obj)
if pdm_isclosed(obj) then order = order - 1
if custom = 1 then first = 1
else first = 2
do star = first to order / 2
min = order
anchor = 0
point = subword(pdm_getpoint(obj,anchor),1,2)
call pdm_initplot()
plotline(point)
p2 = (anchor + star) // order
do while p2 ~= anchor
if p2 < min then min = p2
point = subword(pdm_getpoint(obj,p2),1,2)
plotline(point)
p2 = (p2 + star) // order
end
call pdm_closeplot()
do anchor = 1 to min - 1
point = subword(pdm_getpoint(obj,anchor),1,2)
call pdm_initplot()
plotline(point)
p2 = (anchor + star) // order
do while p2 ~= anchor
point = subword(pdm_getpoint(obj,p2),1,2)
plotline(point)
p2 = (p2 + star) // order
end
call pdm_closeplot()
end
call pdm_updatescreen(1)
end
exit_msg()
exit_msg: procedure expose units
do
parse arg message
if message ~= '' then call pdm_Inform(1,message,)
call pdm_SetUnits(units)
exit
end